Skip to content

feat: manage Hero host configuration repository - #60

Merged
xnoto merged 4 commits into
mainfrom
feat/hero-host-config-repository
Sep 5, 2026
Merged

feat: manage Hero host configuration repository#60
xnoto merged 4 commits into
mainfrom
feat/hero-host-config-repository

Conversation

@xnoto

@xnoto xnoto commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Declare hero-host-config as a private repository managed by this OpenTofu root. The repository is the intended canonical home for the physical Hero RHEL host's Ansible configuration, beginning only with node-exporter delivery.

The root will seed the centrally managed Dependabot and Dependabot-notify files after the environment-gated apply. It deliberately excludes the new repository from the organization-wide Cloudflare authentication secret broadcast: a future host-management credential must be purpose-built, narrowly scoped, and separately approved.

No driving issue was supplied; this is owner-authorized infrastructure bootstrap work.

Fixes #

None.

Type of change

  • Bug fix
  • Feature / enhancement
  • Documentation
  • Infrastructure (OpenTofu root or module)
  • GitOps desired state (manifests, kustomize, charts, SOPS/KSOPS secrets)
  • Container image
  • CI / reusable workflow
  • Refactor / cleanup
  • Breaking change

Validation

  • Required pull-request checks pass — pending: opentofu / test and opentofu / plan are the sole validation authority.
  • Generated or centrally distributed files were regenerated by their owning automation, not hand-edited — the existing github_repository_file resources will create the Dependabot and notification files only after a successful root apply.

No local OpenTofu init, plan, apply, import, state, or secret-decryption operation was run or claimed.

Impact and rollout

Producer: tfroot-github defines the private repository, its topics, and central Dependabot enrollment. It is the only changed producer.

Consumer: hero-host-config does not exist until this root's environment-gated main apply succeeds. No Ansible playbook, host bootstrap script, Cloudflare configuration, Prometheus scrape target, alert rule, GitHub Actions deploy workflow, or host credential is included in this change.

Future scope: the first repository change will be limited to node-exporter. Any later adoption of physical-host libvirt configuration, post-Ansible SSH identities, Plex Media Server, or yt-dlp must be a separately reviewed ownership migration. tfroot-libvirt currently remains the canonical owner of libvirt guest lifecycle, not the physical RHEL host configuration.

Delivery stages: authored on this branch; PR validation is pending. Merge, environment-gated root apply, repository creation, central file seeding, Ansible repository authorship, host bootstrap, scrape selection, reconciliation, and functional verification remain incomplete.

Rollback: before apply, close or revert this PR. After an applied repository-creation change, do not blindly revert the resource because destruction may delete the managed repository; make an explicit archival or retention decision in a separate reviewed change.

Safety and secrets

  • Contains no plaintext secrets, decrypted SOPS values, state files, kubeconfigs, tokens, or private endpoints.
  • No local OpenTofu init/plan/apply/destroy/import/state operations were run or claimed — plans come from pull-request checks.
  • Breaking or irreversible effects are described above with rollback notes.

AI-assisted change: an OpenCode agent materially prepared this branch and pull request. Review the repository-creation plan, private visibility, generic Cloudflare-secret exclusion, and generated-file ownership before merge.

@xnoto
xnoto requested a review from a team as a code owner September 5, 2026 16:47
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Test

OpenTofu test passed.

View the workflow run.

View run output
Terraform validate.......................................................Passed
Terraform validate with tflint...........................................Passed
Checkov..................................................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Detect hardcoded secrets.................................................Passed
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check vcs permalinks.....................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
don't commit to branch..................................................Skipped
check for added large files..............................................Passed

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Plan

OpenTofu plan passed.

View the workflow run.

View run output
OpenTofu will perform the following actions:

  # github_repository.repositories["hero-host-config"] will be created
  + resource "github_repository" "repositories" {
      + allow_auto_merge                        = false
      + allow_forking                           = (known after apply)
      + allow_merge_commit                      = true
      + allow_rebase_merge                      = false
      + allow_squash_merge                      = true
      + archived                                = false
      + auto_init                               = true
      + default_branch                          = (known after apply)
      + delete_branch_on_merge                  = true
      + etag                                    = (known after apply)
      + fork                                    = (known after apply)
      + full_name                               = (known after apply)
      + git_clone_url                           = (known after apply)
      + html_url                                = (known after apply)
      + http_clone_url                          = (known after apply)
      + id                                      = (known after apply)
      + ignore_vulnerability_alerts_during_read = false
      + merge_commit_message                    = "PR_TITLE"
      + merge_commit_title                      = "MERGE_MESSAGE"
      + name                                    = "hero-host-config"
      + node_id                                 = (known after apply)
      + primary_language                        = (known after apply)
      + private                                 = (known after apply)
      + repo_id                                 = (known after apply)
      + source_owner                            = (known after apply)
      + source_repo                             = (known after apply)
      + squash_merge_commit_message             = "PR_BODY"
      + squash_merge_commit_title               = "PR_TITLE"
      + ssh_clone_url                           = (known after apply)
      + svn_url                                 = (known after apply)
      + topics                                  = [
          + "ansible",
          + "cloudflare-zero-trust",
          + "configuration-management",
          + "node-exporter",
          + "rhel",
          + "systemd",
        ]
      + visibility                              = "private"
      + vulnerability_alerts                    = (known after apply)
      + web_commit_signoff_required             = (known after apply)

      + security_and_analysis (known after apply)
    }

  # github_repository_file.dependabot["hero-host-config"] will be created
  + resource "github_repository_file" "dependabot" {
      + autocreate_branch_source_sha = (known after apply)
      + branch                       = (known after apply)
      + commit_message               = "chore: sync managed dependabot configuration"
      + commit_sha                   = (known after apply)
      + content                      = <<-EOT
            # Managed by tfroot-github (gh-dependabot.tf); local edits are overwritten.
            "updates":
            - "directory": "/"
              "groups":
                "github-actions":
                  "patterns":
                  - "*"
              "package-ecosystem": "github-actions"
              "schedule":
                "interval": "daily"
            "version": 2
        EOT
      + file                         = ".github/dependabot.yml"
      + id                           = (known after apply)
      + overwrite_on_create          = true
      + ref                          = (known after apply)
      + repository                   = "hero-host-config"
      + repository_id                = (known after apply)
      + sha                          = (known after apply)
    }

  # github_repository_file.dependabot_notify["hero-host-config"] will be created
  + resource "github_repository_file" "dependabot_notify" {
      + autocreate_branch_source_sha = (known after apply)
      + branch                       = (known after apply)
      + commit_message               = "chore: sync managed dependabot notification workflow"
      + commit_sha                   = (known after apply)
      + content                      = <<-EOT
            ---
            # Managed by tfroot-github (gh-dependabot.tf); local edits are overwritten.
            name: dependabot-notify
            
            on:
              pull_request:
                types: [opened, reopened]
            
            permissions: {}
            
            jobs:
              notify:
                if: github.actor == 'dependabot[bot]'
                uses: makeitworkcloud/shared-workflows/.github/workflows/_dependabot-notify.yml@main
[REDACTED: potentially sensitive plan output]
        EOT
      + file                         = ".github/workflows/dependabot-notify.yml"
      + id                           = (known after apply)
      + overwrite_on_create          = true
      + ref                          = (known after apply)
      + repository                   = "hero-host-config"
      + repository_id                = (known after apply)
      + sha                          = (known after apply)
    }

  # github_team_repository.admins["hero-host-config"] will be created
  + resource "github_team_repository" "admins" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "admin"
      + repository = "hero-host-config"
      + team_id    = "15594330"
    }

Plan: 4 to add, 0 to change, 0 to destroy.
OpenTofu will perform the following actions:

  # github_repository.repositories["hero-host-config"] will be created
  + resource "github_repository" "repositories" {
      + allow_auto_merge                        = false
      + allow_forking                           = (known after apply)
      + allow_merge_commit                      = true
      + allow_rebase_merge                      = false
      + allow_squash_merge                      = true
      + archived                                = false
      + auto_init                               = true
      + default_branch                          = (known after apply)
      + delete_branch_on_merge                  = true
      + etag                                    = (known after apply)
      + fork                                    = (known after apply)
      + full_name                               = (known after apply)
      + git_clone_url                           = (known after apply)
      + html_url                                = (known after apply)
      + http_clone_url                          = (known after apply)
      + id                                      = (known after apply)
      + ignore_vulnerability_alerts_during_read = false
      + merge_commit_message                    = "PR_TITLE"
      + merge_commit_title                      = "MERGE_MESSAGE"
      + name                                    = "hero-host-config"
      + node_id                                 = (known after apply)
      + primary_language                        = (known after apply)
      + private                                 = (known after apply)
      + repo_id                                 = (known after apply)
      + source_owner                            = (known after apply)
      + source_repo                             = (known after apply)
      + squash_merge_commit_message             = "PR_BODY"
      + squash_merge_commit_title               = "PR_TITLE"
      + ssh_clone_url                           = (known after apply)
      + svn_url                                 = (known after apply)
      + topics                                  = [
          + "ansible",
          + "cloudflare-zero-trust",
          + "configuration-management",
          + "node-exporter",
          + "rhel",
          + "systemd",
        ]
      + visibility                              = "private"
      + vulnerability_alerts                    = (known after apply)
      + web_commit_signoff_required             = (known after apply)

      + security_and_analysis (known after apply)
    }

  # github_repository_file.dependabot["hero-host-config"] will be created
  + resource "github_repository_file" "dependabot" {
      + autocreate_branch_source_sha = (known after apply)
      + branch                       = (known after apply)
      + commit_message               = "chore: sync managed dependabot configuration"
      + commit_sha                   = (known after apply)
      + content                      = <<-EOT
            # Managed by tfroot-github (gh-dependabot.tf); local edits are overwritten.
            "updates":
            - "directory": "/"
              "groups":
                "github-actions":
                  "patterns":
                  - "*"
              "package-ecosystem": "github-actions"
              "schedule":
                "interval": "daily"
            "version": 2
        EOT
      + file                         = ".github/dependabot.yml"
      + id                           = (known after apply)
      + overwrite_on_create          = true
      + ref                          = (known after apply)
      + repository                   = "hero-host-config"
      + repository_id                = (known after apply)
      + sha                          = (known after apply)
    }

  # github_repository_file.dependabot_notify["hero-host-config"] will be created
  + resource "github_repository_file" "dependabot_notify" {
      + autocreate_branch_source_sha = (known after apply)
      + branch                       = (known after apply)
      + commit_message               = "chore: sync managed dependabot notification workflow"
      + commit_sha                   = (known after apply)
      + content                      = <<-EOT
            ---
            # Managed by tfroot-github (gh-dependabot.tf); local edits are overwritten.
            name: dependabot-notify
            
            on:
              pull_request:
                types: [opened, reopened]
            
            permissions: {}
            
            jobs:
              notify:
                if: github.actor == 'dependabot[bot]'
                uses: makeitworkcloud/shared-workflows/.github/workflows/_dependabot-notify.yml@main
[REDACTED: potentially sensitive plan output]
        EOT
      + file                         = ".github/workflows/dependabot-notify.yml"
      + id                           = (known after apply)
      + overwrite_on_create          = true
      + ref                          = (known after apply)
      + repository                   = "hero-host-config"
      + repository_id                = (known after apply)
      + sha                          = (known after apply)
    }

  # github_team_repository.admins["hero-host-config"] will be created
  + resource "github_team_repository" "admins" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "admin"
      + repository = "hero-host-config"
      + team_id    = "15594330"
    }

Plan: 4 to add, 0 to change, 0 to destroy.

@xnoto
xnoto merged commit 830ae6c into main Sep 5, 2026
3 checks passed
@xnoto
xnoto deleted the feat/hero-host-config-repository branch September 5, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant